package org.openinsula.vulcano.orm.dao.hibernate;

import static org.junit.Assert.assertEquals;

import org.junit.Test;
import org.openinsula.vulcano.orm.dao.query.PropertiesDaoQuery;
import org.openinsula.vulcano.orm.entity.Person;

public class FromHqlDaoQueryVisitorTestCase {

	private FromHqlDaoQueryVisitor visitor = new FromHqlDaoQueryVisitor();

	@Test
	public void testPropertiesDaoQuery() {
		PropertiesDaoQuery<String> query = new PropertiesDaoQuery<String>(Person.class, "name", "age");

		assertEquals("select name, age from org.openinsula.vulcano.orm.entity.Person as k", query.accept(visitor));

		query = new PropertiesDaoQuery<String>(Person.class, "name");

		assertEquals("select name from org.openinsula.vulcano.orm.entity.Person as k", query.accept(visitor));
	}

}
